package com.itheima.test1;

public class TestMath {
    public static void main(String[] args) {
        //绝对值
        double abs = Math.abs(-19.7);
        System.out.println(abs);
        //向上取整
        double ceil = Math.ceil(10.1);
        System.out.println(ceil);
        //向下取整
        double floor = Math.floor(10.9);
        System.out.println(floor);
        //四舍五入
        double round = Math.round(5.8);
        System.out.println(round);
        double r = Math.round(5.1);
        System.out.println(r);
        //两个数的最大值
        int max = Math.max(12, 19);
        System.out.println(max);
        //两个数的最小值
        int min = Math.min(10, 20);
        System.out.println(min);
        //a的b次幂
        double pow = Math.pow(2, 4);
        System.out.println(pow);
        //返回值为double的正值，[0.0,1.0)
        double random = Math.random();
        System.out.println(random);
    }
}
